package service.impl;

import bean.pojo.GdCategory;
import dao.GdCategoryMapper;
import org.springframework.stereotype.Service;
import service.GdCategoryService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GdCategoryServiceImpl implements GdCategoryService {

    @Resource
    private GdCategoryMapper gdCategoryDao;

    public int insert(GdCategory pojo){
        return gdCategoryDao.insert(pojo);
    }

    public int insertList(List< GdCategory> pojos){
        return gdCategoryDao.insertList(pojos);
    }

    public List<GdCategory> select(){
        return gdCategoryDao.select();
    }

    /**
     * 通过标签查询
     * @param categoryId
     * @return
     */
    @Override
    public GdCategory selectByCategoryId(Long categoryId) {
        return gdCategoryDao.selectByCategoryId(categoryId);
    }

    /**
     * 查找所有一级标签
     * @return
     */
    @Override
    public List<GdCategory> selectAllBase() {
        return gdCategoryDao.selectAllBase();
    }

    public int update(GdCategory pojo){
        return gdCategoryDao.update(pojo);
    }

}
